package cn.adelyn.blog.api.search.feign;

import cn.adelyn.blog.api.search.pojo.bo.DeleteBlogBO;
import cn.adelyn.blog.api.search.pojo.bo.InsertBlogBO;
import cn.adelyn.common.core.response.ServerResponseEntity;
import cn.adelyn.common.feign.config.FeignInsideAuthConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "adelyn-blog-search", contextId ="blog", path = "/blog/search")
public interface BlogSearchFeignClient {

    /**
     * 添加 blog
     */
    @PostMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX)
    ServerResponseEntity insertBlog(@RequestBody @Validated InsertBlogBO insertBlogBO);

    /**
     * 更新 blog
     */
    @PutMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX)
    ServerResponseEntity updateBlog(@RequestBody @Validated InsertBlogBO insertBlogBO);

    /**
     * 删除 blog
     */
    @DeleteMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX)
    ServerResponseEntity deleteBlog(@RequestBody @Validated DeleteBlogBO deleteBlogBO);
}
